# 定义颜色转义序列  
BLACK = '\033[30m'  
RED = '\033[31m'  
GREEN = '\033[32m'  
YELLOW = '\033[33m'  
BLUE = '\033[34m'  
PURPLE = '\033[35m'  
CYAN = '\033[36m'  
WHITE = '\033[37m'  
  
# 重置颜色的转义序列  
RESET = '\033[0m'  


def print_default(text, end="\n"):
    print(RESET + text, end=end) 

def print_black(text, end="\n"):
    print(BLACK + text + RESET, end=end) 

def print_red(text, end="\n"):
    print(RED + text + RESET, end=end)  

def print_green(text, end="\n"):
    print(GREEN + text + RESET, end=end) 

def print_yellow(text, end="\n"):
    print(YELLOW  + text + RESET, end=end) 

def print_blue(text, end="\n"):
    print(BLUE + text + RESET, end=end) 

def print_purple(text, end="\n"):
    print(PURPLE  + text + RESET, end=end) 

def print_cyan(text, end="\n"):
    print(CYAN  + text + RESET, end=end)

def print_white(text, end="\n"):
    print(WHITE  + text + RESET, end=end)


 
if __name__ == '__main__':
    s = "这是要显示的文本"
    print_default(f"缺省：{s}")
    print_black(f"黑色：{s}")
    print_red(f"红色：{s}")
    print_green(f"绿色：{s}")
    print_yellow(f"黄色：{s}")
    print_blue(f"蓝色：{s}")
    print_purple(f"紫色：{s}")
    print_cyan(f"青色：{s}")
    print_white(f"白色：{s}")